﻿CREATE TABLE [dbo].[Publicidade] (
    [Id]                 INT           IDENTITY (1, 1) NOT NULL,
    [IdAdministrador]    INT           NULL,
    [IdContrato]         INT           NULL,
    [IdLocalBanner]      INT           NOT NULL,
    [HorarioInicial]     VARCHAR (5)   NULL,
    [HorarioFinal]       VARCHAR (5)   NULL,
    [Titulo]             VARCHAR (40)  NULL,
    [Conteudo]           VARCHAR (255) NULL,
    [Imagem]             VARCHAR (50)  NULL,
    [URLRedirecionar]    VARCHAR (255) NULL,
    [URLPagina]          VARCHAR (255) NULL,
    [NivelVisibilidade]  TINYINT       NULL,
    [UltimaVisualizacao] DATETIME      NULL,
    [Pago]               BIT           DEFAULT ((0)) NOT NULL,
    [Ativo]              BIT           NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF),
    FOREIGN KEY ([IdAdministrador]) REFERENCES [dbo].[Administrador] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([IdContrato]) REFERENCES [dbo].[Contrato] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION,
    FOREIGN KEY ([IdLocalBanner]) REFERENCES [dbo].[LocalBanner] ([Id]) ON DELETE NO ACTION ON UPDATE NO ACTION
);



